def count_one_times(n):
    """
    统计一个数中1出现的次数
    :param n:
    :return:
    """
    flag=1
    i=1
    count = 0
    while i <= 64:
        if flag & n:
            count += 1
        flag <<= 1
        i += 1
    return count

print(count_one_times(-5))
